import request from '@/utils/request'

// 查询缓存详细
export function getCache(requestBody) {
  if(requestBody == undefined){
    requestBody = {
      data:{}
    }
  }
  return request({
    url: '/system/cache',
    method: 'post',
    data:requestBody
  })
}

// 查询缓存名称列表
export function listCacheName(requestBody) {
  if(requestBody == undefined){
    requestBody = {
      data:{}
    }
  }
  return request({
    url: '/system/cache/getNames',
    method: 'post',
    data: requestBody
  })
}

// 查询缓存键名列表
export function listCacheKey(requestBody) {
  return request({
    url: '/system/cache/getKeys',
    method: 'post',
    data: requestBody
  })
}

// 查询缓存内容
export function getCacheValue(requestBody) {
  if(requestBody == undefined){
    requestBody = {
      data:{}
    }
  }
  return request({
    url: '/system/cache/getValue',
    method: 'post',
    data:requestBody
  })
}

// 清理指定名称缓存
export function clearCacheName(requestBody) {
  if(requestBody == undefined){
    requestBody = {
      data:{}
    }
  }
  return request({
    url: '/system/cache/clearCacheName',
    method: 'post',
    data: requestBody
  })
}

// 清理指定键名缓存
export function clearCacheKey(requestBody) {
  if(requestBody == undefined){
    requestBody = {
      data:{}
    }
  }
  return request({
    url: '/system/cache/clearCacheKey',
    method: 'post',
    data: requestBody
  })
}

// 清理全部缓存
export function clearCacheAll(requestBody) {
  if(requestBody == undefined){
    requestBody = {
      data:{}
    }
  }
  return request({
    url: '/system/cache/clearCacheAll',
    method: 'post',
    data: requestBody
  })
}
